package com.yazq.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.validation.ObjectError;
@Data
public class Result {
    private String msg;
    private Object data;
    private Integer code;

    public static Result success(){
        Result result = new Result();
        result.msg = "success";
        result.code = 200;
        return result;
    }

    public static Result success(Object data){
        Result result = new Result();
        result.msg = "success";
        result.code = 200;
        result.data = data;
        return result;
    }

    public static Result error(){
        Result result = new Result();
        result.msg = "error";
        result.code = 500;
        return result;
    }
}
